#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "algorithm/algorithmdialogbase.h"
#include "algorithm/dialog/binarysearch/binarysearchdialog.h"
#include <QLabel>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void _init();
    void resetOutput();

    void _setNameAndMovie();

public slots:
    void onRecvOutput(QVector<QString> strVector);
    void timeUpdate();
    void onAboutAuthor();
    void onOpenBinarySearchDialog();
    void onOpenBubbleSortDialog();
private slots:

private:
    Ui::MainWindow *ui;
    QLabel *currentTimeLabel = nullptr;
    QTimer *timer = nullptr;
    AlgorithmDialogBase *algorithmDialog = nullptr;
    QMovie *movie = nullptr;

    // 算法枚举值
    enum {
        BINARYSEARCH,
        BUBBLESORT
    };
};
#endif // MAINWINDOW_H
